package com.lxp.userms.mapper;

import com.lxp.userms.entity.Post;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface PostMapper {
    int insertPost(Post post);
    Post selectPostById(int id);
    List<Post> selectAllPosts();
    List<Post> selectPostsByUserId(int userId);
    int updatePost(Post post);
    int deletePost(int id);
    int deletePostsByCategoryId(int categoryId);
    List<Post> selectPostsByCategoryId(int categoryId); // 添加按分类查询
    List<Post> searchPostsByKeyword(String keyword);   // 添加关键词搜索
}